package kr.or.kead.ui.input;

import java.awt.BorderLayout;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.MouseListener;
import java.util.TreeSet;

import javax.swing.FocusManager;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.KeyStroke;

public abstract class AbsInput extends JPanel implements ActionListener, KeyListener {
	protected JFrame frame = new JFrame();
	protected Font font = new Font(Font.DIALOG_INPUT, Font.BOLD, 15);
	protected JPanel northPanel, southPanel;
	protected JButton btn_save, btn_del, btn_search;
	/*TreeSet<KeyStroke> FORWARD = new TreeSet<KeyStroke>();
	TreeSet<KeyStroke> BACKWARD = new TreeSet<KeyStroke>();*/
	
	protected void initialize() {
		setLayout(new BorderLayout());
		/*FORWARD.add(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0));
		BACKWARD.add(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, InputEvent.SHIFT_MASK));*/
		create_north_panel();
		create_south_panel();
		add(northPanel, BorderLayout.CENTER);
		add(southPanel, BorderLayout.SOUTH);
		frame.getContentPane().add(this);
	}
	
	

	
	protected abstract void create_north_panel();
	protected abstract void create_south_panel();	
	protected abstract int regular_expressin();
	protected abstract void clear_component();




	@Override
	public void keyPressed(KeyEvent e) {
		FocusManager fm = FocusManager.getCurrentManager();
		if(e.getKeyCode() == KeyEvent.VK_ENTER) {
			fm.focusNextComponent();
		}
		
	}


	public void keyReleased(KeyEvent e) {}
	public void keyTyped(KeyEvent e) {}
	public void actionPerformed(ActionEvent arg0) {}

	
	
	
}
